package com.zrrd.blog.article.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zrrd.blog.api.entities.Article;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zrrd.blog.api.entities.UserInfoREQ;
import com.zrrd.blog.article.req.ArticleListREQ;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 文章信息表 Mapper 接口
 * </p>
 *
 * @author chen
 * @since 2023-08-06
 */
public interface ArticleMapper extends BaseMapper<Article> {
    Article findArticleAndLabelById(String id);

    boolean deleteArticleLable(@Param("articleId") String articleId);

    boolean saveArticleLable(@Param("articleId") String articleId, @Param("lableIds") List<String> listIds);

    IPage<Article> findListByLabelIdOrCategoryId(IPage<Article> page, @Param("req") ArticleListREQ req);

    List<Map<String, Object>> selectCategoryTotal();

    boolean updateUserInfo(UserInfoREQ req);
}
